
<%@ page import="com.scau.ums.model.Info" %>
<%@ page import="java.util.List" %>
<%@ page import="com.github.pagehelper.PageInfo" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/7/25
  Time: 16:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<%
    List<Info>  AllInfoList = (List<Info>) request.getAttribute("AllInfoList");
    PageInfo infoPager= (PageInfo) request.getAttribute("pageInfo");

%>
<body>
AllInfo界面
您共有<%=infoPager.getTotal()%>条信息<br>
<%
    for(int i=0;i<AllInfoList.size();i++){
        Info info = AllInfoList.get(i);
%>
<a href="showSpecifiedInfo?InfoId=<%=info.getId()%>"><%=info.getTitle()%><br></a>
<%
    }
%>


<div class="page text-right clearfix" style="margin-top: 40px">
    <!-- 当前页为第一页时href="javascript:void(0)" 禁用 a 标签的点击时间事件 
      当前页不是第一页时请求url 中返回currentPage=pageInfo.pageNum - 1  当前页 -1-->
    <a <c:if test="${pageInfo.pageNum != pageInfo.firstPage}">href="AlertUncheckedInfo?currentPage=${pageInfo.pageNum - 1 }"</c:if>
       <c:if test="${pageInfo.pageNum == pageInfo.firstPage}">href="javascript:void(0)" class="disabled"</c:if> 
    >上一页</a>

    <!-- foreach 从 1 开始 到 总页数结束  遍历输出 -->
    <c:forEach begin="1" end="${pageInfo.pages }" varStatus="status">
        <a href="AlertAllInfo?currentPage=${status.count }"
           <c:if test="${status.count == pageInfo.pageNum}">class="select"</c:if>>${status.count }</a>
    </c:forEach>
    <!-- 当前页为最后一页时href="javascript:void(0)" 禁用 a 标签的点击时间事件 
        当前页不是最后一页时请求url 中返回currentPage=${pageInfo.pageNum - 1 } 当前页 -1-->
    <a <c:if test="${pageInfo.pageNum == pageInfo.lastPage}">class="disabled" href="javascript:void(0)"</c:if>
       <c:if test="${pageInfo.pageNum != pageInfo.lastPage}">href="AlertAllInfo?currentPage=${pageInfo.pageNum + 1 }"</c:if> 
    >下一页</a>
</div>
</body>
</html>
